# -*- coding: utf-8 -*-
'''
计算分段函数
'''
import math
x = float(input())
res = 0
if x<= -3:
  res = -math.exp(2*x+1)+3
elif x>3:
  res = 2*math.log10(3*x+5)-11
else:
  res = 2*x-1

print('%.6f'%res)